<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<div class="main-content">
    <div class="box box-main">
        <form id="troubleForm" model="post" action="<c:url value="/web/admin/dictInfo/addOrUpdate.action"/>"
              method="post" class="form-horizontal">
            <div class="box-body">
                <div class="form-unit">基本信息</div>
                <input type="hidden" name="createDate" value="<fmt:formatDate value="${dictInfo.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
                <input type="hidden" name="id" value="${dictInfo.id}"/>
                <div class="row">
                    <div class="col-xs-12">
                        <div class="form-group">
                            <label class="control-label col-sm-4" title="">
                                <span class="required">*</span>属性名称：<i class="fa icon-question hide"></i></label>
                            <div class="col-sm-8">
                                <input path="propertyName" name="propertyName" value="${dictInfo.propertyName}"
                                       class="form-control required">
                            </div>
                        </div>
                    </div>
                    <div class="col-xs-12">
                        <div class="form-group">
                            <label class="control-label col-sm-4" title="">
                                <span class="required ">*</span> 属性编码：<i class="fa icon-question hide"></i></label>
                            <div class="col-sm-8">
                                <input path="propertyCode" name="propertyCode" value="${dictInfo.propertyCode}"
                                       maxlength="100" class="form-control required ">
                            </div>
                        </div>
                    </div>
                    <div class="col-xs-12">
                        <div class="form-group">
                            <label class="control-label col-sm-4" title="">
                                <span class="required ">*</span> 类型名称：<i class="fa icon-question hide"></i></label>
                            <div class="col-sm-8">
                                <input path="typeName" name="typeName" value="${dictInfo.typeName}" maxlength="100"
                                       class="form-control ">
                            </div>
                        </div>
                    </div>
                    <div class="col-xs-12">
                        <div class="form-group">
                            <label class="control-label col-sm-4" title="">
                                <span class="required">*</span>类型编码：<i class="fa icon-question hide"></i></label>
                            <div class="col-sm-8">
                                <input path="typeCode" name="typeCode" value="${dictInfo.typeCode}"
                                       class="form-control required">
                            </div>
                        </div>
                    </div>
                    <%--<div class="col-xs-12">--%>
                        <%--<div class="form-group">--%>
                            <%--<label class="control-label col-sm-4" title="">--%>
                                <%--<span class="required">*</span>所属企业：<i class="fa icon-question hide"></i></label>--%>
                            <%--<div class="col-sm-8">--%>
                                <%--<input path="select_enterprise" id="select_enterprise" name="select_enterprise"--%>
                                       <%--class="form-control required">--%>
                            <%--</div>--%>
                        <%--</div>--%>
                    <%--</div>--%>
                </div>
            </div>
            <div class="box-footer">
                <div class="row">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i>
                            保 存
                        </button>&nbsp;

                        <button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="closeView()"><i
                                class="fa fa-times"></i> 关 闭
                        </button>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
<script>
    $("#troubleForm").validate({
        submitHandler: function (form) {
            js.ajaxSubmitForm($(form), function (data) {
                js.showMessage(data.msg);
                if (data.status == Global.NO) {
                    closeView();
                    $('#dataGrid').dataGrid("refresh");
                }
            }, "json");
        }
    });
    <%--var select_enterprise = $('#select_enterprise').magicSuggest({--%>
        <%--allowFreeEntries: false,--%>
        <%--data: '<c:url value="/web/admin/enterprise/getEnterpriseListMagic.action?id=${dictInfo.enterprise.id}" />',--%>
        <%--queryParam: 'q',--%>
        <%--valueField: "value",--%>
        <%--displayField: "text",--%>
        <%--maxSelection: 1,--%>
        <%--noSuggestionText: '',--%>
        <%--placeholder: '请选择',--%>
        <%--required: true,--%>
        <%--autoSelect: true,--%>
        <%--selectFirst: true,--%>
        <%--value: magicSuggestValue('${dictInfo.enterprise.id}')--%>
    <%--});--%>


    function closeView() {
        layer.close(LayWin['wDictInfo']);
    }
</script>


